Add MCP Resource trigger templates for JavaScript and TypeScript#4966
Add MCP Resource trigger templates for JavaScript and TypeScript#4966nturinski merged 2 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds MCP Resource trigger templates for Node.js v4 (JavaScript/TypeScript) and wires them into the existing template verification and MCP-trigger detection logic.
Changes:
- Add Node.js v4 backup templates for
McpResourceTrigger(JavaScript + TypeScript). - Treat
mcpResourceTriggertemplates/bindings as MCP triggers in template parsing and function config detection. - Update script template verification list and adjust backup template count expectations in tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/templateCount.test.ts | Updates expected template counts for JS/TS v4 when using Backup templates. |
| src/templates/script/parseScriptTemplatesV2.ts | Extends MCP trigger detection to include mcpresourcetrigger ids. |
| src/templates/script/getScriptVerifiedTemplateIds.ts | Adds McpResourceTrigger to the verified script template id allowlist. |
| src/funcConfig/function.ts | Updates isMcpTrigger to recognize mcpResourceTrigger. |
| resources/backupTemplates/nodejs-4.x/templates/templates.json | Adds backup templates for MCP Resource triggers (JS + TS). |
| } | ||
| }, | ||
| { | ||
| "id": "McpResourceTrigger-Javascript-4.x", |
There was a problem hiding this comment.
Template id uses McpResourceTrigger-Javascript-4.x (lowercase s) whereas other Node v4 JavaScript templates in this file use the -JavaScript-4.x suffix (e.g., McpToolTrigger-JavaScript-4.x). Since template ids act as stable identifiers across providers/feeds, this inconsistency can lead to mismatches or duplicate templates if another source uses the canonical JavaScript id. Consider renaming the id to McpResourceTrigger-JavaScript-4.x to match the established pattern.
| "id": "McpResourceTrigger-Javascript-4.x", | |
| "id": "McpResourceTrigger-JavaScript-4.x", |
There was a problem hiding this comment.
All the other ids are JavaScript. I think we try to normalize all of the ids so that casing shouldn't matter, but you should still be consistent.
Description:
This PR adds new MCP Resource trigger templates for Node.js v4 projects and integrates them into template discovery/validation flow.
Changes: